﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Inheritance_abstract_polymorphism
{
    abstract class QuizBase
    {
        private string _question;
        public string Question
        {
            set
            {
                _question = value;
            }
            get
            {
                return _question;
            }
        }

        public virtual void ShowQuestion()
        {
            Console.WriteLine(_question);
        }

        public enum QuizDifficulty { Easy, Normal, Hard};
        private QuizDifficulty _difficulty;
        public QuizDifficulty Difficulty
        {
            set
            {
                _difficulty = value;
            }
            get
            {
                return _difficulty;
            }
        }

        public void ShowQuizDifficultyLevel()
        {
            Console.WriteLine("Cau hoi co do kho " + _difficulty.ToString());
        }

        public enum QuizType { LichSu, DiaLy, XaHoi, TheThao, Unknown };
        private QuizType _type;
        public QuizType Type
        {
            set
            {
                _type = value;
            }
            get
            {
                return _type;
            }
        }

        public void ShowQuizType()
        {
            Console.WriteLine("Cau hoi the loai " + _type.ToString());
        }

        public QuizBase(string question, QuizType type, QuizDifficulty difficulty)
        {
            _question = question;
            _difficulty = difficulty;
            _type = type;
        }

        public abstract void ReadAnswer();
        public abstract bool IsCorrect();
        public static void ShowAvailableType()
        {
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("Cac the loai cau hoi: ");
            Console.WriteLine(QuizType.DiaLy.ToString());
            Console.WriteLine(QuizType.LichSu.ToString());
            Console.WriteLine(QuizType.TheThao.ToString());
            Console.WriteLine(QuizType.XaHoi.ToString());
            Console.WriteLine(QuizType.Unknown.ToString());
            Console.ForegroundColor = ConsoleColor.Gray;
        }

        public static void ShowAvailableDifficulty()
        {
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Cac do kho cau hoi: ");
            Console.WriteLine(QuizDifficulty.Easy.ToString());
            Console.WriteLine(QuizDifficulty.Normal.ToString());
            Console.WriteLine(QuizDifficulty.Hard.ToString());
            Console.ForegroundColor = ConsoleColor.Gray;
        }
    }
}
